package com.smz.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smz.dao.TProductDAO;
import com.smz.entity.TProduct;
import com.smz.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class ProductServiceImpl extends ServiceImpl<TProductDAO, TProduct> implements ProductService {
    @Autowired
    TProductDAO tProductDAO;
    @Override
    public IPage<TProduct> findProductByCompanyId(int current, int size, int companyId) {
        return tProductDAO.selectProductByCompanyId(new Page(current,size),companyId);
    }


    @Override
    public IPage<TProduct> findAllPro(int current, int size) {
        return tProductDAO.selectAllPro(new Page(current,size));
    }

    @Override
    public TProduct findProById(int id) {
        return tProductDAO.selectProById(id);
    }
}
